from django.conf import settings
from django.core.files.storage import Storage


class FastDFSStorage(Storage):
    def __init__(self):
        #配置http://192.168.147.128:8888
        self.base_url = settings.FDFS_BASE_URL
        #必须事项 _open _save
    def _open(self, name, mode='rb'):
        pass
    def _save(self, name, content, max_length=None):
        pass
    def url(self,name):
        #拼接文件的 全路径
        return self.base_url + name